@extends('admin.common.main')
@section('css')
<link rel="stylesheet" type="text/css" href="/webuploader/webuploader.css" />
<style>
</style>
@endsection
@section('cnt')
<div class="x-body">
    @include('admin.common.validate')
    @include('admin.common.msg')
    <form class="layui-form" action="{{ route('admin.notice.store') }}" method="post" id="form-member-add">
        {{ csrf_field() }}
        <div class="layui-form-item">
            <label for="fangowner_id" class="layui-form-label">
                <span class="x-red">*</span>房东
            </label>
            <div class="layui-input-inline">
                <input type="text" id="fangowner_id" name="fangowner_id"
                       autocomplete="off" class="layui-input" value="1">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="fangowner_id" class="layui-form-label">
                <span class="x-red"></span>租客
            </label>
            <div class="layui-input-inline">
                <input type="text" id="fangowner_id" name="fangowner_id"
                       autocomplete="off" class="layui-input" value="1">
            </div>
        </div>
         <div class="layui-form-item">
              <label for="dtime" class="layui-form-label">
                  <span class="x-red"></span>预约时间
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="dtime" name="dtime" 
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>
        <div class="layui-form-item">
              <label for="cnt" class="layui-form-label">
                  <span class="x-red">*</span>预约内容
              </label>
              <div class="layui-input-inline">
                  <textarea name="cnt" id="cnt" cols="80" rows="10">{{ old('cnt') }}</textarea>
              </div>
        </div>
        <div class="layui-form-item" style="margin-top: 120px;">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button  class="layui-btn" type="submit">
                添加预约
            </button>
        </div>
    </form>
</div>
@endsection
@section('js')
<script src="/webuploader/webuploader.js"></script>
<script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script>

     layui.use(['laydate','code'], function(){
        var laydate = layui.laydate;
        laydate.render({
            elem: '#dtime', //指定元素
            type:'datetime'
        });
        layui.code();
     });

    $("#form-member-add").validate({
        //规则
        rules:{
            //表单元素名称
            cnt:{
                required:true
            }
           
        },
        messages:{
            cnt:"请输入预约内容",
        },
        onkeyup:false,
        success:"valid",
        submitHandler:function (form) {
            console.log(form)
            form.submit();
        }
    });

</script>
@endsection